home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
doc
/
p3.r
< prev
next >
Wrap
Text File
|
1994-04-25
|
430b
|
22 lines
t = (0:10:.05)';
x = exp (-0.5*t) .* (cos (2*pi*3*t) + sin (2*pi*7*t));
X = fft (x);
rfile faxis
freq = faxis (X, .05, 3);
mag = abs (X);
rfile angle
phase = angle (X);
pstart (1,2,"xwin");
ptitle ("Magnitude of FFT")
xlabel ("Frequency (Hertz)");
plwid(6);
plot ([freq,mag]);
ptitle ("Angle (atan2(imag/real)) of FFT")
xlabel ("Frequency (Hertz)");
ylabel ("Angle (radians)");
plwid(6);
plot ([freq,phase]);
plprint ("p3.ps");